<?php
require_once('auth.php');

//Find the current session info
$login = $_SESSION['SESS_LOGIN'];
$target = "workspace/".$login;

//Receive GET value of the filename "name"

$realPath = realpath($target.'/'.$_GET['name']);
echo $realPath;
//Make sure the filename path is good
$confirm = strpos($realPath, $_SERVER['DOCUMENT_ROOT'].'/REDCAT/'.$target.'/');

if ($confirm !== 0) die('Bad path!');

//Delete the file
unlink($realPath);
?>
